const mysql = require('mysql');

function execSql(sql, callbackFn) {
    // 配置相关参数
    const conn = mysql.createConnection({
        host: '127.0.0.1',
        port: 3306,
        user: 'root',
        password: '123456',
        database: 'hero'
    });

    conn.connect();

    conn.query(sql, callbackFn);

    conn.end();
}

module.exports = execSql;